package com.example.demo.entity;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Opt;
import cn.hutool.core.lang.Tuple;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.tuple.MutablePair;
import org.apache.commons.lang3.tuple.Pair;
import reactor.util.function.Tuple2;
import sun.misc.GC;

import java.io.File;
import java.io.Serializable;
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.function.Consumer;
import java.util.function.Supplier;

/**
 * <p>
 * 
 * </p>
 *
 * @author cdn
 * @since 2025-04-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("menu")
public class Menu implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;


    private String name;

    private Integer parentId;

    private Integer userId;

    @JsonSerialize
    private String content;

    private Integer tenantId;






    public static void main(String[] args) {
        HashMap<String, Integer> map = new HashMap<>();
        List<String> wordsList =  FileUtil.readLines("/Users/caidingnu/Desktop/words-mapping-MX-INS-001.txt","UTF-8");
        for (String s : wordsList) {
            map.merge(s, 1, Integer::sum);
        }
        for (Map.Entry<String, Integer> entry : map.entrySet()) {
            if (entry.getValue()>1) {
                System.out.println(entry.getKey() + ":" + entry.getValue());
            }
        }
    }


    /**
     * @author 蔡定努
     */
    public static void qc(Runnable consumer) {

        consumer.run();


    }

}
